package com.hong610.response;

/**
 * Created by Hong on 2017/2/10.
 */
public class Response {

    private static final String OK = "OK.";
    private static final boolean SUCCESS = true;

    private boolean success = false;
    private String code = "0x00000000";
    private String message = "ERROR.";
    private Object result = null;

    public static Response Error(){
        Response response = new Response();
        return response;
    }

    public static Response Success(){
        Response response = new Response();
        response.setSuccess(SUCCESS);
        response.setMessage(OK);
        return response;
    }

    public static Response Success(Object result){
        Response response = new Response();
        response.setSuccess(SUCCESS);
        response.setMessage(OK);
        response.setResult(result);
        return response;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
